#!/usr/bin/env python3
"""
脚本名称：ch33_exe.py
功能描述：演示 while 和 for 循环进阶用法
作者：Gavin
创建日期：2022-05-06
版本：1.0
依赖库：无
使用方法： python ch33_exe.py
"""


def test_while(total, step):
    i = 0
    numbers = []
    while i < total:
        print("At the top i is %d" % i)
        numbers.append(i)
        i = i + step
        print("Numbers now: ", numbers)
        print("At the bottom i is %d" % i)

    print("The numbers: ")

    for num in numbers:
        print(num)


test_while(6, 2)


def test_for(total, step):
    numbers = []
    for i in range(0, total, step):
        print("At the top i is %d" % i)
        numbers.append(i)
        print("Numbers now: ", numbers)
        print("At the bottom i is %d" % i)


test_for(6, 2)
